unit Unit22; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Calendar,
  Buttons, StdCtrls, ExtDlgs, EditBtn;

type

  { TForm22 }

  TForm22 = class(TForm)
    Button1: TButton;
    Calendar1: TCalendar;
    Calendar2: TCalendar;
    Calendar3: TCalendar;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Calendar1Change(Sender: TObject);
    procedure Calendar2Change(Sender: TObject);
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    { private declarations }
  public
    fecha_desde : String;
    fecha_hasta : String;
  end; 

var
  Form22: TForm22; 

implementation

{ TForm22 }


procedure TForm22.Button1Click(Sender: TObject);
begin
  Close;
end;

procedure TForm22.Calendar1Change(Sender: TObject);
begin
  fecha_desde := Calendar1.Date;
end;

procedure TForm22.Calendar2Change(Sender: TObject);
begin
  fecha_hasta := Calendar2.Date;
end;

procedure TForm22.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  fecha_desde := fecha_desde + ' ' + Edit1.Text;
  fecha_hasta := fecha_hasta + ' ' + Edit2.Text;
end;

procedure TForm22.FormShow(Sender: TObject);
begin
  Edit1.Text := '00:00';
  Edit2.Text := '23:59';
  
  Calendar1.DateTime := Date;
  Calendar2.DateTime := Date;
  
  fecha_desde := Calendar1.Date;
  fecha_hasta := Calendar2.Date;
end;

initialization
  {$I unit22.lrs}

end.

